﻿-bool isUser = (ViewData.ContainsKey("user") && ViewData["user"] is User)
#content
  %form.tableform{action=String.Format("task.ivp/{0}",ViewData["Action"]),method="post"}
    %h1
      %img.icon24{src="img/headericons/task.gif"}
      Заявки
      -if ((ViewData["user"] as IUser).HasPermission("TaskAdmin")) 
        %a.btncreate{href="task.ivp/create"} <img src="img/buttons/create.gif" title="Создать заявку" width="73" height="23"/>
        %a.btndelete{href="#",onclick="return del()",title="Удалить выбранные"} <img src="img/buttons/delete.gif" alt="Удалить выбранные заявки" title="Удалить выбранные заявки" width="134" height="23"/>      
      -if (ViewData.ContainsKey("schedules") && ViewData.ContainsKey("ScheduleId"))
        =HTMLHelper.Select("ScheduleId",ViewData["schedules"] as List<Schedule>,"name","id",Convert.ToInt32(ViewData["ScheduleId"]),"big","Все календари","0",false)
      -if (ViewData.ContainsKey("message"))
        #dialog.inline.popup.info.normal
          =ViewData["message"]
          %a{href="#", onclick="$('#dialog').hide(); return false;"} <img src="img/trash.gif"/>
          -ViewData["message"] = null 
    #tableholder
      _table/table
-if (isUser)
  #rightmenu
    _table/rightfilter